/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ifpb.banco.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author Vanderlan
 */
@Entity
@Table(catalog = "", schema = "VANDERLAN")
@SequenceGenerator(name = "S_HOSPEDE_PK", sequenceName = "S_HOSPEDE_PK")
public class Hospede extends Identificavel {
    private static final long serialVersionUID = 1L;

    @Id
    @Basic(optional = false)
    @Column(name = "COD_HOSPEDE", nullable = false, precision = 0, scale = -127)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "S_HOSPEDE_PK")
    protected Long id;
    @Basic(optional = false)
    @Column(nullable = false, length = 60)
    private String nome;
    @Column(length = 15)
    private String rg;
    @Column(name = "ORGAO_EXPEDIDOR", length = 10)
    private String orgaoExpedidor;
    @Basic(optional = false)
    @Column(nullable = false, length = 11)
    private String cpf;
    @JoinColumn(name = "COD_HOSPEDAGEM", referencedColumnName = "COD_HOSPEDAGEM", nullable = false)
    @ManyToOne(optional = false)
    private Hospedagem codHospedagem;

    public Hospede() {
    }

    public Hospede(Long codHospede) {
        this.id = codHospede;
    }

    public Hospede(Long codHospede, String nome, String cpf) {
        this.id = codHospede;
        this.nome = nome;
        this.cpf = cpf;
    }

    public Long getCodHospede() {
        return id;
    }

    public void setCodHospede(Long codHospede) {
        this.id = codHospede;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getRg() {
        return rg;
    }

    public void setRg(String rg) {
        this.rg = rg;
    }

    public String getOrgaoExpedidor() {
        return orgaoExpedidor;
    }

    public void setOrgaoExpedidor(String orgaoExpedidor) {
        this.orgaoExpedidor = orgaoExpedidor;
    }

    public String getCpf() {
        return cpf;
    }

    public void setCpf(String cpf) {
        this.cpf = cpf;
    }

    public Hospedagem getCodHospedagem() {
        return codHospedagem;
    }

    public void setCodHospedagem(Hospedagem codHospedagem) {
        this.codHospedagem = codHospedagem;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Hospede)) {
            return false;
        }
        Hospede other = (Hospede) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ifpb.banco.principal.entity.Hospede[ codHospede=" + id + " ]";
    }
    
}
